// @ts-ignore
import request from '@/utils/request'
//获取全部文章信息
export const GetArtList = () => {
    return request.get('/my/article/list')
}


// 文章发布
export const artPublishService = (data) => request.post('/my/article/add', data)
    //更新文章
export const artEditService = (data) => {
        // data = JSON.stringify(data)
        return request.put(`/my/article/update/${data.id}`, data)
    }
    // `/sys/abnormalCondition/update/${id}`
    // 删除文章
export const artDelService = ({ id, title }) => request.delete(`/my/article/delete/?id=${id}&title=${title}`)
    // export const artDelService = (id) =>request.delete(`/article/delete${id}`, { params: { id } })

//获取文章详情
export const artGetDetailService = (id) => {
    // return request.get('/article/info', {
    //     params: {
    //         id
    //     }
    // })
    return request.get(`/my/article/info/${id}`)
}

//用户登录 POST /user/login
export const userGetLogin = (data) => {
    return request.post('/user/login', data);
};